package com.tian.enums;

import lombok.Getter;

/**
 * {@code @description:} TODO
 *
 * @author tianwc 公众号：Java后端技术全栈
 * 在线刷题 1200+java面试题和1000+篇技术文章：<a href="https://woaijava.cc/">博客地址</a>
 * {@code @date:} 2024-08-13 22:59
 * {@code @version:} 1.0
 */
@Getter
public enum SendEmailTypeEnums {
    SIMPLE(0, "普通邮件", "sendEmailSimpleMessageService"),
    HTML(1, "HTML邮件", "sendEmailHTMLMessageService"),
    APPENDIX(2, "带附件邮件", "sendEmailAppendixMessageService");

    private final Integer type;
    private final String desc;
    private final String serviceName;

    SendEmailTypeEnums(Integer type, String desc, String serviceName) {
        this.type = type;
        this.desc = desc;
        this.serviceName = serviceName;
    }

    public static String getServiceNameByType(Integer type) {
        for (SendEmailTypeEnums value : SendEmailTypeEnums.values()) {
            if (value.getType().equals(type)) {
                return value.getServiceName();
            }
        }
        return null;
    }
}
